<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    // 订单表
    public function up()
    {
        Schema::create('orders', function (Blueprint $table) {
            // 编号 用户ID 购物车ID 商品ID 状态：1-未发货 2-已发货 3-已收货
            $table->increments('id');
            $table->integer('user_id');
            $table->integer('shop_car_id');
            $table->integer('goods_id');
            $table->tinyInteger('status')->default(1);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('orders');
    }
}
